<?php 
class Pages {
	var $id = null;
	var $title = null;
	var $content = null; 
	var $visible = null;
	var $has_modules = 0;
	var $meta_desc = null;
	var $meta_keys = null;
	var $meta_title = null;
	
	function viewAll() {
		$query = "select * from dt_pages";
		$data = mysql_query($query);
		return $data;
	}
	
	function selectSingle($id) {
		$query = "select * from dt_pages where p_id = '$id'";
		$data = mysql_query($query);
		return $data;
	}
	
	function update($id, $title, $content, $visible, $meta_desc, $meta_keys, $meta_title) {
		$query = "update dt_pages set p_title = '$title', p_content = '$content', p_visible = '$visible', p_meta_desc = '$meta_desc', p_meta_keys = '$meta_keys', p_meta_title = '$meta_title' where p_id = '$id'";
		mysql_query($query);
	}
	
	function insert($title, $content, $visible, $meta_desc, $meta_keys, $meta_title) {
		$query = "insert into dt_pages (p_title, p_content, p_visible, p_meta_desc, p_meta_keys, p_meta_title) values ('$title', '$content', '$visible', '$meta_desc', '$meta_keys', '$meta_title')";
		mysql_query($query);
	}
	
	function delete($id) {
		$query = "delete from dt_pages where p_id = '$id'";
		mysql_query($query);
	}
}
?>